package com.tedu.api;

import org.junit.Test;

public class 作业 {
 @Test
 public void textLength(){
     String s1="HelloJava";
     System.out.println(s1.length());
 }

@Test
public void textIndexOf(){
     String s="HelloJava";
    int index = s.indexOf("o");
    System.out.println("o的位置"+ index);
    index = s.lastIndexOf("o",5);
        System.out.println("o出现位置:" + index);
    }
    @Test
    public void subString() {
     String url="HelloJava";
     String s4=url.substring(0,5);
        System.out.println("截取后字符串"+s4);
        String s5=url.substring(5,9);
        System.out.println("截取后字符串"+s5);

    }

    @Test
    public void testTrim() {
        String s6 = "Hello";
        s6 = s6.trim();
        System.out.println(s6);
    }
    @Test
    public void testCharAt() {
        String s7 = "HelloJava";
        char c = s7.charAt(6);
        System.out.println("获取的字符是：" + c);
    }
    @Test
    public void testUL() {
        String s8 = " HelloJava";
        s8 = s8.toLowerCase().trim();
        System.out.println("转换为小写:" + s8);
        s8 = s8.toUpperCase().trim();
        System.out.println("转换为大写:" + s8);
    }




















}
